package test.marui.com.mytest.view.layerView;

import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import test.marui.com.mytest.R;
import test.marui.com.mytest.view.layerView.view.AnimHelper;
import test.marui.com.mytest.view.layerView.view.AnyLayer;

/**
 * Created by MR on 2019/1/25.
 */
public class LayerNormalActivity extends AppCompatActivity implements View.OnClickListener {

    private static final long ANIM_DURATION = 350;
    private Context mContext;
    private FrameLayout fl_container;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_layer_normal);

        mContext = this;

        fl_container = findViewById(R.id.fl_container);
        TextView tv_screen_all = findViewById(R.id.tv_screen_all);
        TextView tv_screen_top = findViewById(R.id.tv_screen_top);
        TextView tv_screen_bottom = findViewById(R.id.tv_screen_bottom);
        TextView tv_screen_top_custom = findViewById(R.id.tv_screen_top_custom);
        TextView tv_to_right = findViewById(R.id.tv_to_right);
        TextView tv_to_top = findViewById(R.id.tv_to_top);
        TextView tv_to_bottom = findViewById(R.id.tv_to_bottom);
        TextView tv_to_left = findViewById(R.id.tv_to_left);
        TextView tv_bg_blur = findViewById(R.id.tv_bg_blur);
        TextView tv_bg_default = findViewById(R.id.tv_bg_default);
        TextView tv_bg_transparent = findViewById(R.id.tv_bg_transparent);
        TextView tv_bottom_in_bottom_out = findViewById(R.id.tv_bottom_in_bottom_out);
        TextView tv_bottom_in_bottom_out_alpha = findViewById(R.id.tv_bottom_in_bottom_out_alpha);
        TextView tv_top_in_top_out = findViewById(R.id.tv_top_in_top_out);
        TextView tv_top_in_top_out_alpha = findViewById(R.id.tv_top_in_top_out_alpha);
        TextView tv_bottom_in_top_out = findViewById(R.id.tv_bottom_in_top_out);
        TextView tv_bottom_in_top_out_alpha = findViewById(R.id.tv_bottom_in_top_out_alpha);
        TextView tv_top_in_bottom_out = findViewById(R.id.tv_top_in_bottom_out);
        TextView tv_top_in_bottom_out_alpha = findViewById(R.id.tv_top_in_bottom_out_alpha);
        TextView tv_left_in_left_out = findViewById(R.id.tv_left_in_left_out);
        TextView tv_left_in_left_out_alpha = findViewById(R.id.tv_left_in_left_out_alpha);
        TextView tv_right_in_right_out = findViewById(R.id.tv_right_in_right_out);
        TextView tv_right_in_right_out_alpha = findViewById(R.id.tv_right_in_right_out_alpha);
        TextView tv_right_in_left_out = findViewById(R.id.tv_right_in_left_out);
        TextView tv_right_in_left_out_alpha = findViewById(R.id.tv_right_in_left_out_alpha);
        TextView tv_left_in_right_out = findViewById(R.id.tv_left_in_right_out);
        TextView tv_left_in_right_out_alpha = findViewById(R.id.tv_left_in_right_out_alpha);
        TextView tv_circle_in = findViewById(R.id.tv_circle_in);

        tv_screen_all.setOnClickListener(this);
        tv_screen_top.setOnClickListener(this);
        tv_screen_bottom.setOnClickListener(this);
        tv_screen_top_custom.setOnClickListener(this);
        tv_to_right.setOnClickListener(this);
        tv_to_top.setOnClickListener(this);
        tv_to_bottom.setOnClickListener(this);
        tv_to_left.setOnClickListener(this);
        tv_bg_blur.setOnClickListener(this);
        tv_bg_default.setOnClickListener(this);
        tv_bg_transparent.setOnClickListener(this);
        tv_bottom_in_bottom_out.setOnClickListener(this);
        tv_bottom_in_bottom_out_alpha.setOnClickListener(this);
        tv_top_in_top_out.setOnClickListener(this);
        tv_top_in_top_out_alpha.setOnClickListener(this);
        tv_bottom_in_top_out.setOnClickListener(this);
        tv_bottom_in_top_out_alpha.setOnClickListener(this);
        tv_top_in_bottom_out.setOnClickListener(this);
        tv_top_in_bottom_out_alpha.setOnClickListener(this);
        tv_left_in_left_out.setOnClickListener(this);
        tv_left_in_left_out_alpha.setOnClickListener(this);
        tv_right_in_right_out.setOnClickListener(this);
        tv_right_in_right_out_alpha.setOnClickListener(this);
        tv_right_in_left_out.setOnClickListener(this);
        tv_right_in_left_out_alpha.setOnClickListener(this);
        tv_left_in_right_out.setOnClickListener(this);
        tv_left_in_right_out_alpha.setOnClickListener(this);
        tv_circle_in.setOnClickListener(this);

    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        overridePendingTransition(R.anim.fade_left_in, R.anim.fade_right_out);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_screen_all:
                AnyLayer.with(mContext)
                        .contentView(R.layout.view_dialog_all)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(true)
                        .onClickToDismiss(R.id.iv_bg)
                        .show();
                break;
            case R.id.tv_screen_top:
                AnyLayer.with(mContext)
                        .contentView(R.layout.view_dialog_normal)
                        .gravity(Gravity.TOP)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnTouchOutSide(true)
                        .cancelableOnClickKeyBack(false)
                        .onClickToDismiss(R.id.tv_close)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startTopInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startTopOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_screen_bottom:
                AnyLayer.with(mContext)
                        .contentView(R.layout.view_dialog_normal)
                        .backgroundColorRes(R.color.dialog_bg)
                        .gravity(Gravity.BOTTOM)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startBottomInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startBottomOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_screen_top_custom:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal)
                        .backgroundColorRes(R.color.dialog_bg)
                        .gravity(Gravity.TOP)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startTopInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startTopOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_to_right:
                AnyLayer.with(findViewById(R.id.tv_to_right))
                        .direction(AnyLayer.Direction.RIGHT)
                        .gravity(Gravity.LEFT | Gravity.CENTER_VERTICAL)
                        .contentView(R.layout.view_dialog_text)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startLeftInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startLeftOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_to_top:
                AnyLayer.with(findViewById(R.id.tv_to_top))
                        .direction(AnyLayer.Direction.TOP)
                        .gravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM)
                        .contentView(R.layout.view_dialog_text_horizontal)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startBottomInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startBottomOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_to_bottom:
                AnyLayer.with(findViewById(R.id.tv_to_bottom))
                        .direction(AnyLayer.Direction.BOTTOM)
                        .gravity(Gravity.CENTER_HORIZONTAL | Gravity.TOP)
                        .contentView(R.layout.view_dialog_text_horizontal)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startTopInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startTopOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_to_left:
                AnyLayer.with(findViewById(R.id.tv_to_left))
                        .direction(AnyLayer.Direction.LEFT)
                        .gravity(Gravity.CENTER_VERTICAL | Gravity.RIGHT)
                        .contentView(R.layout.view_dialog_text)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startRightInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startRightOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_bg_blur:
                AnyLayer.with(mContext)
                        .contentView(R.layout.view_dialog_normal_center)
                        .cancelableOnTouchOutSide(true)
                        .cancelableOnClickKeyBack(true)
                        .backgroundColorInt(Color.WHITE)
                        .backgroundBlurRadius(8)
                        .backgroundBlurScale(8)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .show();
                break;
            case R.id.tv_bg_default:
                AnyLayer.with(mContext)
                        .contentView(R.layout.view_dialog_normal_center)
                        .cancelableOnTouchOutSide(true)
                        .cancelableOnClickKeyBack(true)
                        .backgroundColorRes(R.color.dialog_bg)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .show();
                break;
            case R.id.tv_bg_transparent:
                AnyLayer.with(mContext)
                        .contentView(R.layout.view_dialog_normal_center)
                        .cancelableOnTouchOutSide(true)
                        .cancelableOnClickKeyBack(true)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .show();
                break;
            case R.id.tv_right_in_right_out:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startRightInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startRightOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_right_in_right_out_alpha:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startRightAlphaInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startRightAlphaOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_left_in_left_out:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startLeftInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startLeftOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_left_in_left_out_alpha:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startLeftAlphaInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startLeftAlphaOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_right_in_left_out:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startRightInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startLeftOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_right_in_left_out_alpha:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startRightAlphaInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startLeftAlphaOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_left_in_right_out:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startLeftInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startRightOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_left_in_right_out_alpha:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startLeftAlphaInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startRightAlphaOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_bottom_in_bottom_out:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startBottomInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startBottomOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_bottom_in_bottom_out_alpha:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startBottomAlphaInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startBottomAlphaOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_top_in_top_out:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startTopInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startTopOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_top_in_top_out_alpha:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startTopAlphaInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startTopAlphaOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_bottom_in_top_out:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startBottomInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startTopOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_bottom_in_top_out_alpha:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startBottomAlphaInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startTopAlphaOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_top_in_bottom_out:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startTopInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startBottomOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_top_in_bottom_out_alpha:
                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {
                                AnimHelper.startTopAlphaInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {
                                AnimHelper.startBottomAlphaOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
            case R.id.tv_circle_in:

                AnyLayer.with(fl_container)
                        .contentView(R.layout.view_dialog_normal_center)
                        .backgroundColorRes(R.color.dialog_bg)
                        .cancelableOnClickKeyBack(true)
                        .cancelableOnTouchOutSide(false)
                        .onClickToDismiss(R.id.tv_close)
                        .onClickToDismiss(R.id.tv_ok)
                        .contentAnim(new AnyLayer.IAnim() {
                            @Override
                            public long inAnim(View targetView) {

                                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
                                    return 0;
                                }

                                AnimHelper.startCircleInAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }

                            @Override
                            public long outAnim(View targetView) {

                                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
                                    return 0;
                                }

                                AnimHelper.startCircleOutAnim(targetView, ANIM_DURATION);
                                return ANIM_DURATION;
                            }
                        })
                        .show();
                break;
        }

    }
}
